<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6_1_1-1-组件的生命周期</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

  <div id="Application"></div>

  <script>
    const root = {
      beforeCreate() {
        console.log("组件即将创建前");
      },

      created() {
        console.log("组件创建完成");
      },

      beforeMount() {
        console.log("组件即将挂载前");
      },

      updated() {
        console.log("组件挂载完成");
      },

      beforeUpdate() {
        console.log("组件即将更新前");
      },

      updated() {
        console.log("组件更新完成");
      },

      activated() {
        console.log("被缓存的组件激活时调用");
      },

      deactivated() {
        console.log("被缓存的组件停用时调用");
      },

      beforeMount() {
        console.log("组件即将被卸载前调用");
      },

      unmounted() {
        console.log("组件被卸载后调用");
      },

      errorCaptured(erro, instance, info) {
        console.log("捕获到来自子组件的异常时调用");
      },

      renderTracked(event) {
        console.log("虚拟DOM重建渲染时调用");
      },

      renderTriggered(event) {
        console.log("虚拟DOM被触发渲染时调用");
      },
    };

    const App = Vue.createApp(root);

    App.mount("#Application"); //将Vue组件绑定到页面上id为Application的元素上。
  </script>
</body>

</html>